<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <h1 style="padding-left: 20%;color: aqua;font: size 100px;">这是9月17日的JS课程</h1>
    <script>
        let month = "12"
        month = prompt("请输入月份") //输入提示框，函数的返回值定义给month
            // console.log(month)

        let day = "31"
        day = prompt("请输入日期")
            // console.log(day)

        let name = "hang"
        name = prompt("请输入名字")

        let age = "hang"
        age = prompt("请输入存活时间")

        function time(month, day) {
            console.log("今天是2025年" + month + "月" + day + "日, 早上好")
            return "今天是2025年" + month + "月" + day + "日，" + name + "先生，你已经存活了" + age + "年"
        }
        let second = time(month, day) //将time函数的返回值赋给second
        alert(second)

        let year = time //将time函数重新定义为名为year的函数
        year(month, 15)

        let daily = function(month, day) { //匿名函数
            console.log("今天是2025年" + month + "月" + day + "日, 晚上好")
            return day
        }
        daily(9, day)

        let hi = (name) => { //箭头函数
            alert(name + "，欢迎使用")
        }
        hi(name)

        let hey = (name) => //箭头函数
            alert(name + "，再见")
        hey(name)

        let go = name => { //箭头函数
            alert(name + "，欢迎再次使用")
        }
        go(name)

        let num = 20
        console.log(typeof num)

        let str = "王"
        console.log(typeof str)

        let boo = true
        console.log(typeof boo)

        let obj = null
        console.log(typeof obj)

        let kk = {
            name: "white",
            age: 50
        }
        console.log(typeof kk)

        let un = undefined
        console.log(typeof un)

        console.log(typeof hi)

        let arr = [1, 2, 3, 7, 9]
        console.log(typeof arr)
        console.log(arr instanceof Array) //判断是否是Array类型

        console.log(arr)
        console.log(Array)
        console.log(time) //time的类型是function

        let arr1 = new Array("你", "好", "嘛") //再次判断是否相同
        console.log(arr1 instanceof Array)

        let sss = new String("我", "不好")
        console.log(sss instanceof Array)
        console.log(sss instanceof String)
    </script>
</body>

</html>